<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/c" prefix="c" %>
<%@taglib prefix="display" uri="http://displaytag.sf.net/el"%>
<%@ page import="java.text.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.lang.*"%>
<%@ page import="com.solution.webconstant.PermissionConstants" %>

<%
	HashMap permissionMap = ((HashMap)(session.getAttribute("userPermissionsInfo")));
%>
<script language="JavaScript">
function fnSearch()
{
	document.userForm.action='/searchUserResult.do?';
	document.userForm.submit();
}
function fnEditViewUserDetails(user_id_value, screen_type_value){
	document.userForm.screen_type.value=screen_type_value;
	document.userForm.user_id.value=user_id_value;
	document.userForm.action='/userSearchdetails.do?';
	document.userForm.submit();
}
</script>
<script language="JavaScript" src="js/Calendar.js" type="text/JavaScript"></script>
<html:form action="/searchUserResult">
	<html:hidden property="show_list" />
	<html:hidden property="screen_type" />
	<html:hidden property="user_id" />
	<table width="90%" align="center" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td>&nbsp;</td>
		</tr>
		<tr>
 			<td class="heading1">User Search Form</td>
		</tr>
		<tr>
			<td valign="top">&nbsp;</td>
		</tr>
		<tr>
			<td valign="top"><jsp:include page="showErrorMessage.jsp"/></td>
		</tr>
	  	<tr>
			<td>
				<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
					<tr>
						<td align="left" valign="top" class="inputtext">First Name</td>
						<td valign="middle" ><input name="first_name" id="first_name" class="form1" maxlength="20"/></td>
						<td align="left" valign="top" class="inputtext">Last Name</td>
						<td valign="middle"><input name="last_name" id="last_name" class="form1" maxlength="20"/></td>
					</tr>
					<tr>
						<td align="left" valign="top" class="inputtext">User Name</td>
						<td valign="middle" ><input name="user_name" id="user_name" class="form1" maxlength="20"/></td>
						<td align="left" valign="top" class="inputtext">User Type</td>
						<td valign="middle">
							<html:select styleClass="form3" property="user_type" styleId="user_type" style=":width=72%">								
								<html:option value="1">Examiner</html:option>
								<html:option value="2">Examinee</html:option>
							</html:select>
						</td>
					</tr>
  					<tr>
						<td height="25" colspan="4" valign="top"  >&nbsp;</td>
					</tr>
					<tr>
						<td colspan="4" valign="top"  bgcolor="#CCCCCC"><img src="images/zero.gif" width="1" height="1" /></td>
					</tr>
					<tr>
						<td height="25" colspan="4" align="center" valign="top" >&nbsp;</td>
					</tr>
					<tr>
       	 				<td height="25" colspan="4" align="center" valign="top">
       	 					<input type="button" class="imageButton" value="Search" onClick="JavaScript:fnSearch()">
       	 				</td>
      				</tr>
      				<tr>
						<td height="25" colspan="4" align="center" valign="top" >&nbsp;</td>
					</tr>
				</table>
          	</td>
		</tr>
		<tr>
			<td>
				<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
					<logic:equal name="userForm" property="show_list" value="Y">
					<tr>
						<td>
							<display:table name="userForm.user_list" decorator="com.solution.decorator.UserDecorator"
								export="false"	requestURI="/searchUserResult.do" cellspacing="0" cellpadding="0"
								pagesize="10" class="results" id="user">
								<display:column property="firstName" title="First Name" />
								<display:column property="lastName" title="Last Name" />
								<display:column property="username" title="User Name" />
								<logic:present property="status" name="user">
								<bean:define id="displayStatus" property="status" name="user"/>
								<display:column title="Status"><bean:message key="<%="UserStatus."+displayStatus%>"/></display:column>
								</logic:present>								
								<logic:equal name="userForm" property="screen_type" value="Edit">
									<display:column property="actionEdit" title="Action" />
								</logic:equal>
								<logic:equal name="userForm" property="screen_type" value="View">
									<display:column property="actionView" title="Action" />
								</logic:equal>
								<display:setProperty name="basic.msg.empty_list">&nbsp;</display:setProperty> 
							</display:table>
						</td>
            		</tr>
            		</logic:equal>
          		</table>
          	</td>
		</tr>
      </table>
</html:form>